package com.tripwego.client.ui.widget;

import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.ToggleButton;

public class IconActiviteWidget extends ToggleButton {

	private String iconUrl;

	private String iconUrldown;

	private String iconUrlDisabled;

	private String type;

	/**
	 * @param type
	 *            : http://code.google.com/intl/fr-FR/apis/maps/documentation/
	 *            places/supported_types.html
	 */
	public IconActiviteWidget(String iconName, String type, String title) {
		super();

		String prefix = "icons/";
		String suffix = ".png";

		iconUrl = prefix + iconName + suffix;
		iconUrldown = prefix + iconName + "_down" + suffix;
		iconUrlDisabled = prefix + iconName + "_disabled" + suffix;

		this.removeStyleName("gwt-ToggleButton");
		this.setStyleName("iconActiviteWidget");

		this.getUpFace().setImage(new Image(iconUrl));
		this.getDownFace().setImage(new Image(iconUrldown));
		this.getUpDisabledFace().setImage(new Image(iconUrlDisabled));

		this.setSize("1%", "1%");
		this.type = type;

		this.setTitle(title);
	}

	/**
	 * @return the iconUrl
	 */
	public String getIconUrl() {
		return iconUrl;
	}

	/**
	 * @param iconUrl
	 *            the iconUrl to set
	 */
	public void setIconUrl(String iconUrl) {
		this.iconUrl = iconUrl;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type
	 *            the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the iconUrldown
	 */
	public String getIconUrldown() {
		return iconUrldown;
	}

	/**
	 * @param iconUrldown
	 *            the iconUrldown to set
	 */
	public void setIconUrldown(String iconUrldown) {
		this.iconUrldown = iconUrldown;
	}

	/**
	 * @return the iconUrlDisabled
	 */
	public String getIconUrlDisabled() {
		return iconUrlDisabled;
	}

	/**
	 * @param iconUrlDisabled
	 *            the iconUrlDisabled to set
	 */
	public void setIconUrlDisabled(String iconUrlDisabled) {
		this.iconUrlDisabled = iconUrlDisabled;
	}
}
